#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		int a, b;
		cin >> a >> b;
		cout << 2 << endl;
		cout << 1 << " " << b - 1 << endl << a << " " << b << endl;
	}
	return 0;
}